<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
	[v-cloak]{display: none;}
	</style>
</head>
<body>
<div v-cloak id="app">
	<button @click="lang">浪起来</button>
	<button @click="stop">别浪</button>
	<p>{{ msg }}</p>
</div>
<script src="node_modules/vue/dist/vue.js"></script>
<script>
var vm = new Vue({
	el : '#app',
	data : {
		interId : null,
		msg : '猥琐发育，别浪~~~！'
	},
	methods : {
		lang(){
			if (this.interId) {
				return
			}
			this.interId = setInterval(() => {
				var start = this.msg.substring(0, 1)
				var end = this.msg.substring(1)
				this.msg = end + start
			}, 300)	
		},
		stop(){
			clearTimeout(this.interId)
			this.interId = null
		}
	}
})
</script>
</body>
</html>